package com.bm.specialvehiclefordispatcher.logics;

import com.bm.corelibs.logic.BaseLogic.NListener;
import com.bm.specialvehiclefordispatcher.bean.BaseData;
import com.bm.specialvehiclefordispatcher.constants.Urls;

public class AnnouncementManager extends BaseManager {

	private String sentObject;

	public AnnouncementManager(String sentObject) {
		this.sentObject = sentObject;
	}

	@Override
	protected void getList(NListener<BaseData> l) {
		logic.edit().resetAll().addParam("sentUser", sentObject).addParam("sentObject", "2").addParam("pageNo", page.pageNo + "").addParam("pageSize", Integer.MAX_VALUE + "").setUrl(Urls.GET_ANNOUNCEMENTS).setBaseClass(BaseData.class).setListener(l);
		logic.doPost();

	}

	public void removeAnnouncment(long id, NListener<BaseData> listener) {
		logic.edit().resetAll().addParam("id", id + "").setBaseClass(BaseData.class).setListener(listener).setUrl(Urls.REMOVE_ANNOUNCEMNET);
		logic.doPost();
	}
}
